<ion-view view-title="销售单详情">
    <ion-content class="wrap-light2 supplier-theOrder">

	<ion-list>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">开单时间</span>
		    <time>{{theOrder.date | date:'yyyy-MM-dd hh:mm:ss'}}</time>
		</ion-item>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">类型</span>
		    <time>{{theOrder.price_type}}</time>
		</ion-item>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">状态</span>
		    <span class="balanced">{{theOrder.state}}</span>
		</ion-item>

		<ion-item class="item-icon-left item-icon-right" ng-if="theOrder.customer.name">
		    <span class="list-label text-right">客户</span>
		    <span>{{theOrder.customer.name}}</span>
		</ion-item>

		<ion-item class="item item-divider margin-top-large">
		    销售清单
		</ion-item>

		<ion-item class="item" ng-repeat="product in theOrder.list">
		    <div class="row row-center row-nopadding">
				<div class="col">
					<p>{{product.properties.brand.value}}{{product.properties.model.value}}</p>
					<div class="meta padding-bottom">
						<span>数量：{{product.count}} 部 </span>
						<span>成交单价：{{product.final_price | currency:'￥'}} </span>
						<span class="pull-right nomargin">小计：{{product.final_price * product.count | currency:'￥'}}</span>
					</div>
					<div class="prop-list item-accordion">
						<p ng-repeat="property in product.properties" class="prop-item" ng-if="property.name!='品牌' && property.name!='型号'">
							<span class="prop-label">{{property.name}}:</span>
							<span class="prop-value">{{property.value}}</span>
						</p>
					</div>
				</div>

				<div class="text-right">{{product.state}}</div>
			</div>
		</ion-item>

			<ion-item class="padding" ng-if="theOrder.amount">
			    <div class="row row-center">
					<div>总计：</div>
					<div class="col text-right">{{theOrder.amount | currency:'￥'}}</div>
				</div>

			</ion-item>
	</ion-list>

  </ion-content>
</ion-view>
